package com.guaju.yueshangLife.activity;

import android.databinding.DataBindingUtil;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

import com.afollestad.materialdialogs.DialogAction;
import com.afollestad.materialdialogs.MaterialDialog;
import com.guaju.yueshangLife.R;
import com.guaju.yueshangLife.base.MyAppcomActivity;
import com.guaju.yueshangLife.databinding.ActivityRequestRefundDetailBinding;

import java.util.Date;

public class RequestRefundDetailActivity extends MyAppcomActivity {

    private ActivityRequestRefundDetailBinding binding;
    MaterialDialog cancelDialog;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding = DataBindingUtil.setContentView(this,R.layout.activity_request_refund_detail);
        setListener();
    }

    private void setListener() {
        binding.cancelRequest.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                  cancelDialog = new MaterialDialog.Builder(RequestRefundDetailActivity.this)
                        .title("撤销申请")
                        .content("您将撤销本次申请，如还有问题，您可再次发起，确认继续？")
                        .negativeText("确认")
                        .negativeColor(getResources().getColor(R.color.c_gray1))
                        .positiveText("继续")
                        .positiveColor(getResources().getColor(R.color.colorPrimary))
                        .onPositive(new MaterialDialog.SingleButtonCallback() {
                            @Override
                            public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
//                                TODO
                                cancelDialog.dismiss();
                            }
                        })
                        .onNegative(new MaterialDialog.SingleButtonCallback() {
                            @Override
                            public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
                                cancelDialog.dismiss();
                            }
                        })
                        .build();
                  cancelDialog.show();
            }
        });
    }
}
